//创建一个路由器并暴露出去
import { createRouter,createWebHistory } from 'vue-router'
//import {routes} from 'vue-router/auto-routes'
import Home from '@/pages/Home.vue'
import News from '@/pages/News.vue'
import About from '@/pages/About.vue'
import NewsContent  from "@/pages/News-content.vue";

const router = createRouter({
    history: createWebHistory(),
    routes:[
    {
        name:'zhuye',
        path:'/home',
        component:Home
    },
        {
            name:'xinwen',
            path:'/news',
            component:News,
            children:[
                {
                    path:'detail',
                    component:NewsContent
                }
            ]
        },
        {
            name:'about',
            path:'/about',
            component:About
        }
    ]
})

export default router